package com.yoyo.svgdemo.fragment;/**
 * Created by liumin on 2015-9-1.
 */


import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.yoyo.svgdemo.R;

/**
 * User: Missa
 * Date: 2015-09-01
 * Time: 15:28
 * Description:
 */
public class FragmentSVG1 extends BaseFragment {

    public static FragmentSVG1 newInstance(Bundle bundle){
        FragmentSVG1 f = new FragmentSVG1();
        f.setArguments(bundle);

        return f;
    }


    @Override
    public View initiateView(LayoutInflater inflater, ViewGroup container) {
        View view;

        if(Build.VERSION.SDK_INT >= 21){
            view = inflater.inflate(R.layout.fragment_item_1, container, false);
            ImageView imageView = (ImageView) view.findViewById(R.id.frag1_image);
            AnimatedVectorDrawable drawable = ((AnimatedVectorDrawable) imageView.getDrawable());
            drawable.start();
        }else{
            view = new TextView(getActivity());
        }

        return view;
    }

    @Override
    public void initData() {

    }
}
